/*---------------------------鼠标移上的显示和隐藏-------------------------*/
$(function(){
	function customHover(hoverEle,blockEle){
		$(hoverEle).mouseover(function(){
			$(blockEle).css("display","block");
		})
		$(hoverEle).mouseout(function(){
			$(blockEle).css("display","none");
		})
	}
							/*----------index.html----------*/
	customHover("#fixedBox .fuwu","#fixedBox .position-guanzhu")
							
	customHover("#header .head-all .head-right .guanzhu","#header .head-all .position-guanzhu")
	customHover("#header .head-all .position-guanzhu","#header .head-all .position-guanzhu")
	
	customHover("#header .head-all .head-right .dingyue","#header .head-all .position-dingyue")
	customHover("#header .head-all .position-dingyue","#header .head-all .position-dingyue")
	
	customHover("#banner .banner-all .banner-left","#banner .banner-all .banner-left .prev-btn")
	customHover("#banner .banner-all .banner-left","#banner .banner-all .banner-left .next-btn")
							/*-----------list.html----------*/
	customHover("#nav .nav-all .hoverEle","#nav .nav-all .blockEle")
	customHover("#nav .nav-all .blockEle","#nav .nav-all .blockEle")
})
/*-------------------------------轮播图--------------------------------*/
$(function(){
	var bannerIndex = 0;
	var bannerTimer = null;
	var dotList = document.getElementsByClassName("dot-list")[0];
	var dotLis = dotList.getElementsByTagName("li");
	function bannerShow(){
		bannerIndex++;
		if (bannerIndex > 2) {
			bannerIndex = 0;
		}	
		$("#banner .banner-all .banner-left .banner-wrapper").animate({"left":-700*bannerIndex});
		for (var i=0;i<dotLis.length;i++) {
			dotLis[i].className = " ";
		}
		dotLis[bannerIndex].className = "active";
	}
	$("#banner .banner-all .banner-left .prev-btn").click(function(){
		bannerIndex = bannerIndex-1;
		if (bannerIndex < 0) {
			bannerIndex = 2;
		}
		$("#banner .banner-all .banner-left .banner-wrapper").animate({"left":-700*bannerIndex});
		$("#banner .banner-all .banner-left .banner-wrapper").animate({"left":-700*bannerIndex});
		for (var i=0;i<dotLis.length;i++) {
			dotLis[i].className = " ";
		}
		dotLis[bannerIndex].className = "active";
	
	})
	$("#banner .banner-all .banner-left .next-btn").click(function(){
		bannerIndex = bannerIndex+1;
		if (bannerIndex > 2) {
			bannerIndex = 0;
		}
		$("#banner .banner-all .banner-left .banner-wrapper").animate({"left":-700*bannerIndex});
		$("#banner .banner-all .banner-left .banner-wrapper").animate({"left":-700*bannerIndex});
		for (var i=0;i<dotLis.length;i++) {
			dotLis[i].className = " ";
		}
		dotLis[bannerIndex].className = "active";
	
	})
	bannerTimer = setInterval(bannerShow,2000)
	$("#banner .banner-all .banner-left").mouseover(function(){
		clearInterval(bannerTimer);
	})
	$("#banner .banner-all .banner-left").mouseout(function(){
	bannerTimer = setInterval(bannerShow,2000)
	})
})









































